package com.xzq.bugstack.server;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.codec.http.HttpResponseEncoder;

/**
 * @Author xzq
 * @Description //TODO
 * @Date 2021/11/20 11:18
 * @Version 1.0.0
 **/
public class MyChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        //数据解码操作
        ch.pipeline().addLast(new HttpRequestDecoder());
        //数据编码操作
        ch.pipeline().addLast(new HttpResponseEncoder());

        ch.pipeline().addLast(new MyServerHandler());
    }
}
